function [Xtar, Ytar] = drawTarget(task, pos)

global diameter PosTarget
global res
global TaskColor

cgflip(0,0,0);
switch res
    case 3
        cgmakesprite(62,1024,768,0,0,0);
    case 5
        cgmakesprite(62,1280,1024,0,0,0);
end
cgsetsprite(62)         
cgpencol(1,1,1);  
cgpenwid(5)

Xtar = PosTarget*cos(pos);
Ytar = PosTarget*sin(pos);

cgpencol( TaskColor(task,1),TaskColor(task,2),TaskColor(task,3) );
cgellipse(Xtar,Ytar,diameter,diameter,'f');

cgsetsprite(0)
cgflip;
% cgdrawsprite(62,0,0)

return 

